package com.ruanxie.entity;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseScheduleOfStudent {
    private String studentId;
//    private Map<String,Object> courseSchedule;
    private Object courseSchedule;

    public void setCourseSchedule(byte[] courseScheduleBytes) {
        if (courseScheduleBytes != null) {
            String json = new String(courseScheduleBytes, StandardCharsets.UTF_8);
            this.courseSchedule = JSON.parseObject(json, Map.class);
        }
    }
}
